@draftbit/core 46.10.3-1ab4b6.2 → 46.10.3-258cfa.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/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +2 -17
- package/lib/commonjs/components/Shadow.js +2 -15
- package/lib/commonjs/components/Table/Table.js +5 -7
- package/lib/commonjs/components/Table/TableCell.js +3 -3
- package/lib/commonjs/components/Table/TableRow.js +4 -4
- package/lib/commonjs/components/Table/index.js +25 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/Layout.js +177 -85
- package/lib/commonjs/mappings/NativeBase/Layout.js +108 -0
- package/lib/module/components/Table/Table.js +5 -5
- package/lib/module/components/Table/TableCell.js +1 -1
- package/lib/module/components/Table/TableRow.js +1 -1
- package/lib/module/components/Table/index.js +21 -0
- package/lib/module/mappings/Layout.js +178 -86
- package/lib/module/mappings/NativeBase/Layout.js +101 -0
- package/lib/typescript/src/components/Table/Table.d.ts +3 -7
- 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/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 +18 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Layout.d.ts +108 -72
- package/lib/typescript/src/mappings/Layout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +133 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +3 -4
- package/src/components/Table/Table.tsx +3 -7
- package/src/components/Table/TableCell.js +1 -1
- package/src/components/Table/TableCell.tsx +1 -5
- package/src/components/Table/TableRow.js +1 -1
- package/src/components/Table/TableRow.tsx +1 -1
- package/src/components/Table/index.js +12 -0
- package/src/components/Table/index.tsx +41 -0
- package/src/mappings/Layout.js +176 -100
- package/src/mappings/Layout.ts +178 -116
- package/src/mappings/NativeBase/Layout.js +124 -0
- package/src/mappings/NativeBase/Layout.ts +145 -0
- package/lib/commonjs/components/Table/TableCommon.js +0 -30
- package/lib/module/components/Table/TableCommon.js +0 -21
- package/lib/typescript/src/components/Table/TableCommon.d.ts +0 -20
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +0 -1
- package/src/components/Table/TableCommon.js +0 -12
- package/src/components/Table/TableCommon.ts +0 -40
|
@@ -12,7 +12,6 @@ var _theming = require("../../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
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); }
|
|
16
15
|
const AccordionItem = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -27,9 +26,10 @@ const AccordionItem = _ref => {
|
|
|
27
26
|
textStyles,
|
|
28
27
|
viewStyles
|
|
29
28
|
} = (0, _utilities.extractStyles)(style);
|
|
30
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
31
|
-
style: [styles.container, viewStyles]
|
|
32
|
-
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
30
|
+
style: [styles.container, viewStyles],
|
|
31
|
+
...rest
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
33
33
|
style: styles.row
|
|
34
34
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
@@ -61,4 +61,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
|
+
exports.default = _default;.StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
padding: 8
|
|
67
|
+
},
|
|
68
|
+
row: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
paddingLeft: 8
|
|
72
|
+
},
|
|
73
|
+
item: {
|
|
74
|
+
marginVertical: 6,
|
|
75
|
+
paddingLeft: 8
|
|
76
|
+
},
|
|
77
|
+
content: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
justifyContent: "center"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
64
83
|
exports.default = _default;
|
|
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _context = require("./context");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
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); }
|
|
12
13
|
const {
|
|
13
14
|
Provider
|
|
14
15
|
} = _context.checkboxGroupContext;
|
|
@@ -30,23 +31,7 @@ const CheckboxGroup = _ref => {
|
|
|
30
31
|
alignItems: "center"
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
34
|
-
style: [{
|
|
35
|
-
minHeight: 40
|
|
36
|
-
}, style],
|
|
37
|
-
...rest
|
|
38
|
-
}, /*#__PURE__*/React.createElement(Provider, {
|
|
39
|
-
value: {
|
|
40
|
-
values,
|
|
41
|
-
onValueChange,
|
|
42
|
-
direction
|
|
43
|
-
}
|
|
44
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
45
|
-
style: _containerStyle
|
|
46
|
-
}, children)));
|
|
47
|
-
};
|
|
48
|
-
var _default = CheckboxGroup;
|
|
49
|
-
exports.default = _default;s({
|
|
34
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
50
35
|
style: [{
|
|
51
36
|
minHeight: 40
|
|
52
37
|
}, style]
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNativeShadow = require("react-native-shadow-2");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
10
11
|
const Shadow = _ref => {
|
|
11
12
|
let {
|
|
12
13
|
offsetX = 0,
|
|
@@ -23,7 +24,7 @@ const Shadow = _ref => {
|
|
|
23
24
|
style,
|
|
24
25
|
...rest
|
|
25
26
|
} = _ref;
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, _extends({
|
|
27
28
|
offset: [offsetX, offsetY],
|
|
28
29
|
sides: {
|
|
29
30
|
start: showShadowSideStart,
|
|
@@ -38,20 +39,6 @@ const Shadow = _ref => {
|
|
|
38
39
|
bottomEnd: showShadowCornerBottomEnd
|
|
39
40
|
},
|
|
40
41
|
containerStyle: style,
|
|
41
|
-
paintInside: paintInside,
|
|
42
|
-
...rest
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var _default = Shadow;
|
|
46
|
-
exports.default = _default;showShadowSideBottom
|
|
47
|
-
},
|
|
48
|
-
corners: {
|
|
49
|
-
topStart: showShadowCornerTopStart,
|
|
50
|
-
topEnd: showShadowCornerTopEnd,
|
|
51
|
-
bottomStart: showShadowCornerBottomStart,
|
|
52
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
53
|
-
},
|
|
54
|
-
containerStyle: style,
|
|
55
42
|
paintInside: paintInside
|
|
56
43
|
}, rest));
|
|
57
44
|
};
|
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
10
|
-
var _TableCommon = require("./TableCommon");
|
|
9
|
+
var _index = require("./index");
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
const Table = _ref => {
|
|
13
12
|
let {
|
|
14
|
-
theme,
|
|
15
13
|
borderWidth = 1,
|
|
16
|
-
borderColor =
|
|
14
|
+
borderColor = "rgba(200, 200, 200, 1)",
|
|
17
15
|
borderStyle = "solid",
|
|
18
16
|
drawTopBorder = true,
|
|
19
17
|
drawBottomBorder = false,
|
|
@@ -98,7 +96,7 @@ const Table = _ref => {
|
|
|
98
96
|
cellHorizontalPadding,
|
|
99
97
|
cellVerticalPadding
|
|
100
98
|
};
|
|
101
|
-
const borderViewStyle = (0,
|
|
99
|
+
const borderViewStyle = (0, _index.generateBorderStyles)({
|
|
102
100
|
borderColor,
|
|
103
101
|
borderWidth,
|
|
104
102
|
borderStyle,
|
|
@@ -107,7 +105,7 @@ const Table = _ref => {
|
|
|
107
105
|
drawStartBorder,
|
|
108
106
|
drawEndBorder
|
|
109
107
|
});
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_index.TableStyleContext.Provider, {
|
|
111
109
|
value: contextValue
|
|
112
110
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
113
111
|
style: [styles.container, borderViewStyle, style]
|
|
@@ -118,6 +116,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
118
116
|
flex: 1
|
|
119
117
|
}
|
|
120
118
|
});
|
|
121
|
-
var _default =
|
|
119
|
+
var _default = Table;
|
|
122
120
|
exports.default = _default;
|
|
123
121
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
9
|
+
var _index = require("./index");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const TableCell = _ref => {
|
|
12
12
|
let {
|
|
@@ -22,8 +22,8 @@ const TableCell = _ref => {
|
|
|
22
22
|
children,
|
|
23
23
|
style
|
|
24
24
|
} = _ref;
|
|
25
|
-
const parentContextValue = _react.default.useContext(
|
|
26
|
-
const borderViewStyle = (0,
|
|
25
|
+
const parentContextValue = _react.default.useContext(_index.TableStyleContext);
|
|
26
|
+
const borderViewStyle = (0, _index.generateBorderStyles)({
|
|
27
27
|
borderColor: borderColor || parentContextValue.borderColor,
|
|
28
28
|
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
29
29
|
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
9
|
+
var _index = require("./index");
|
|
10
10
|
var _theming = require("../../theming");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const TableRow = _ref => {
|
|
@@ -25,7 +25,7 @@ const TableRow = _ref => {
|
|
|
25
25
|
style,
|
|
26
26
|
theme
|
|
27
27
|
} = _ref;
|
|
28
|
-
const parentContextValue = _react.default.useContext(
|
|
28
|
+
const parentContextValue = _react.default.useContext(_index.TableStyleContext);
|
|
29
29
|
|
|
30
30
|
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
31
31
|
const contextValue = {
|
|
@@ -35,7 +35,7 @@ const TableRow = _ref => {
|
|
|
35
35
|
cellHorizontalPadding: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
36
36
|
cellVerticalPadding: cellVerticalPadding || parentContextValue.cellVerticalPadding
|
|
37
37
|
};
|
|
38
|
-
const borderViewStyle = (0,
|
|
38
|
+
const borderViewStyle = (0, _index.generateBorderStyles)({
|
|
39
39
|
borderColor: contextValue.borderColor,
|
|
40
40
|
borderWidth: contextValue.borderWidth,
|
|
41
41
|
borderStyle: contextValue.borderStyle,
|
|
@@ -44,7 +44,7 @@ const TableRow = _ref => {
|
|
|
44
44
|
drawStartBorder,
|
|
45
45
|
drawEndBorder
|
|
46
46
|
});
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_index.TableStyleContext.Provider, {
|
|
48
48
|
value: contextValue
|
|
49
49
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
50
|
style: [borderViewStyle, isTableHeader ? {
|
|
@@ -21,7 +21,31 @@ Object.defineProperty(exports, "TableRow", {
|
|
|
21
21
|
return _TableRow.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
exports.TableStyleContext = void 0;
|
|
25
|
+
exports.generateBorderStyles = generateBorderStyles;
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
24
27
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
25
28
|
var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
26
29
|
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
27
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
const TableStyleContext = /*#__PURE__*/_react.default.createContext({});
|
|
32
|
+
exports.TableStyleContext = TableStyleContext;
|
|
33
|
+
function generateBorderStyles(_ref) {
|
|
34
|
+
let {
|
|
35
|
+
borderColor,
|
|
36
|
+
borderWidth,
|
|
37
|
+
borderStyle,
|
|
38
|
+
drawTopBorder,
|
|
39
|
+
drawBottomBorder,
|
|
40
|
+
drawStartBorder,
|
|
41
|
+
drawEndBorder
|
|
42
|
+
} = _ref;
|
|
43
|
+
return {
|
|
44
|
+
borderColor,
|
|
45
|
+
borderStyle,
|
|
46
|
+
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
47
|
+
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
48
|
+
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
49
|
+
borderEndWidth: drawEndBorder ? borderWidth : 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
@@ -5,104 +5,196 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const SHARED_SEED_DATA = {
|
|
9
|
-
category: _types.COMPONENT_TYPES.layout,
|
|
10
|
-
packageName: "native-base",
|
|
11
|
-
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS
|
|
12
|
-
};
|
|
13
|
-
const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = _types.CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== _types.StylesPanelSections.LayoutFlexItems && item !== _types.StylesPanelSections.LayoutContent);
|
|
14
8
|
const SEED_DATA = [{
|
|
15
|
-
name: "Aspect Ratio",
|
|
16
|
-
tag: "AspectRatio",
|
|
17
|
-
description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
|
|
18
|
-
...SHARED_SEED_DATA,
|
|
19
|
-
props: {
|
|
20
|
-
ratio: (0, _types.createStaticNumberProp)({
|
|
21
|
-
label: "Ratio",
|
|
22
|
-
description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
|
|
23
|
-
defaultValue: 1.33
|
|
24
|
-
})
|
|
25
|
-
},
|
|
26
|
-
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects]
|
|
27
|
-
}, {
|
|
28
|
-
name: "Box",
|
|
29
|
-
tag: "Box",
|
|
30
|
-
description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
|
|
31
|
-
...SHARED_SEED_DATA
|
|
32
|
-
}, {
|
|
33
|
-
name: "Center",
|
|
34
|
-
tag: "Center",
|
|
35
|
-
description: "Center aligns its contents to the center within itself",
|
|
36
|
-
...SHARED_SEED_DATA,
|
|
37
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
38
|
-
}, {
|
|
39
|
-
name: "Circle",
|
|
40
|
-
tag: "Circle",
|
|
41
|
-
description: "Center aligns its contents to the center within itself with a round border radius",
|
|
42
|
-
...SHARED_SEED_DATA,
|
|
43
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
44
|
-
}, {
|
|
45
|
-
name: "Container",
|
|
46
|
-
tag: "Container",
|
|
47
|
-
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
48
|
-
props: {
|
|
49
|
-
centerContent: (0, _types.createStaticBoolProp)({
|
|
50
|
-
label: "Center content",
|
|
51
|
-
description: "Center child elements based on their content width",
|
|
52
|
-
defaultValue: true
|
|
53
|
-
})
|
|
54
|
-
},
|
|
55
|
-
...SHARED_SEED_DATA
|
|
56
|
-
}, {
|
|
57
|
-
name: "Column",
|
|
58
|
-
tag: "Column",
|
|
59
|
-
description: "Column aligns items vertically",
|
|
60
|
-
layout: {
|
|
61
|
-
flexDirection: "column"
|
|
62
|
-
},
|
|
63
|
-
...SHARED_SEED_DATA
|
|
64
|
-
}, {
|
|
65
9
|
name: "Row",
|
|
66
10
|
tag: "Row",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
11
|
+
category: _types.COMPONENT_TYPES.deprecated,
|
|
12
|
+
stylesPanelSections: [_types.StylesPanelSections.NoStyles],
|
|
13
|
+
props: {
|
|
14
|
+
justifyContent: {
|
|
15
|
+
label: "Align Horizontally",
|
|
16
|
+
group: _types.GROUPS.style,
|
|
17
|
+
description: "Align Items Horizontally (on the X Axis)",
|
|
18
|
+
formType: _types.FORM_TYPES.string,
|
|
19
|
+
propType: _types.PROP_TYPES.STRING,
|
|
20
|
+
defaultValue: "flex-start",
|
|
21
|
+
editable: true,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
alignItems: {
|
|
25
|
+
label: "Align Vertically",
|
|
26
|
+
group: _types.GROUPS.style,
|
|
27
|
+
description: "Align Items Vertically (on the Y Axis)",
|
|
28
|
+
formType: _types.FORM_TYPES.string,
|
|
29
|
+
propType: _types.PROP_TYPES.STRING,
|
|
30
|
+
defaultValue: "flex-start",
|
|
31
|
+
editable: true,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
72
35
|
}, {
|
|
73
36
|
name: "Spacer",
|
|
74
37
|
tag: "Spacer",
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
38
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
39
|
+
props: {
|
|
40
|
+
top: {
|
|
41
|
+
label: "Top",
|
|
42
|
+
description: "Top",
|
|
43
|
+
formType: _types.FORM_TYPES.number,
|
|
44
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
45
|
+
group: _types.GROUPS.style,
|
|
46
|
+
defaultValue: 8,
|
|
47
|
+
editable: true,
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
50
|
+
right: {
|
|
51
|
+
label: "Right",
|
|
52
|
+
description: "Right",
|
|
53
|
+
formType: _types.FORM_TYPES.number,
|
|
54
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
55
|
+
group: _types.GROUPS.style,
|
|
56
|
+
defaultValue: 8,
|
|
57
|
+
editable: true,
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
bottom: {
|
|
61
|
+
label: "Bottom",
|
|
62
|
+
description: "Bottom",
|
|
63
|
+
formType: _types.FORM_TYPES.number,
|
|
64
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
65
|
+
group: _types.GROUPS.style,
|
|
66
|
+
defaultValue: 8,
|
|
67
|
+
editable: true,
|
|
68
|
+
required: false
|
|
69
|
+
},
|
|
70
|
+
left: {
|
|
71
|
+
label: "Left",
|
|
72
|
+
description: "Left",
|
|
73
|
+
formType: _types.FORM_TYPES.number,
|
|
74
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
75
|
+
group: _types.GROUPS.style,
|
|
76
|
+
defaultValue: 8,
|
|
77
|
+
editable: true,
|
|
78
|
+
required: false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
81
|
}, {
|
|
82
82
|
name: "Stack",
|
|
83
83
|
tag: "Stack",
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
category: _types.COMPONENT_TYPES.deprecated,
|
|
85
|
+
stylesPanelSections: [_types.StylesPanelSections.NoStyles],
|
|
86
|
+
props: {
|
|
87
|
+
justifyContent: {
|
|
88
|
+
group: _types.GROUPS.style,
|
|
89
|
+
label: "Justify",
|
|
90
|
+
description: "Justify horizontally",
|
|
91
|
+
formType: _types.FORM_TYPES.string,
|
|
92
|
+
propType: _types.PROP_TYPES.STRING,
|
|
93
|
+
defaultValue: "flex-start",
|
|
94
|
+
editable: true,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
alignItems: {
|
|
98
|
+
group: _types.GROUPS.style,
|
|
99
|
+
label: "Align",
|
|
100
|
+
description: "Vertical align",
|
|
101
|
+
formType: _types.FORM_TYPES.string,
|
|
102
|
+
propType: _types.PROP_TYPES.STRING,
|
|
103
|
+
defaultValue: "flex-start",
|
|
104
|
+
editable: true,
|
|
105
|
+
required: false
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
name: "Center",
|
|
110
|
+
tag: "Center",
|
|
111
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
112
|
+
stylesPanelSections: [_types.StylesPanelSections.NoStyles],
|
|
86
113
|
props: {
|
|
87
|
-
|
|
88
|
-
label: "
|
|
89
|
-
description: "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
114
|
+
width: {
|
|
115
|
+
label: "Width",
|
|
116
|
+
description: "Width",
|
|
117
|
+
formType: _types.FORM_TYPES.number,
|
|
118
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
119
|
+
group: _types.GROUPS.style,
|
|
120
|
+
defaultValue: 240,
|
|
121
|
+
editable: true,
|
|
122
|
+
required: false
|
|
123
|
+
},
|
|
124
|
+
height: {
|
|
125
|
+
label: "Height",
|
|
126
|
+
description: "Height",
|
|
127
|
+
formType: _types.FORM_TYPES.number,
|
|
128
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
129
|
+
group: _types.GROUPS.style,
|
|
130
|
+
defaultValue: 200,
|
|
131
|
+
editable: true,
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
bgColor: {
|
|
135
|
+
label: "Background Color",
|
|
136
|
+
description: "Background color",
|
|
137
|
+
formType: _types.FORM_TYPES.color,
|
|
138
|
+
propType: _types.PROP_TYPES.THEME,
|
|
139
|
+
editable: true,
|
|
140
|
+
required: false,
|
|
141
|
+
defaultValue: "light",
|
|
142
|
+
group: _types.GROUPS.style
|
|
143
|
+
}
|
|
95
144
|
}
|
|
96
145
|
}, {
|
|
97
|
-
name: "
|
|
98
|
-
tag: "
|
|
99
|
-
|
|
100
|
-
|
|
146
|
+
name: "Circle",
|
|
147
|
+
tag: "Circle",
|
|
148
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
149
|
+
stylesPanelSections: [_types.StylesPanelSections.NoStyles],
|
|
150
|
+
props: {
|
|
151
|
+
size: {
|
|
152
|
+
label: "Size",
|
|
153
|
+
description: "Size",
|
|
154
|
+
formType: _types.FORM_TYPES.number,
|
|
155
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
156
|
+
group: _types.GROUPS.style,
|
|
157
|
+
defaultValue: 50,
|
|
158
|
+
editable: true,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
bgColor: {
|
|
162
|
+
label: "Background Color",
|
|
163
|
+
description: "Background color",
|
|
164
|
+
formType: _types.FORM_TYPES.color,
|
|
165
|
+
propType: _types.PROP_TYPES.THEME,
|
|
166
|
+
editable: true,
|
|
167
|
+
required: false,
|
|
168
|
+
defaultValue: "light",
|
|
169
|
+
group: _types.GROUPS.style
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
name: "Square",
|
|
174
|
+
tag: "Square",
|
|
175
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
176
|
+
stylesPanelSections: [_types.StylesPanelSections.NoStyles],
|
|
101
177
|
props: {
|
|
102
|
-
|
|
103
|
-
label: "
|
|
104
|
-
description: "
|
|
105
|
-
|
|
178
|
+
size: {
|
|
179
|
+
label: "Size",
|
|
180
|
+
description: "Size",
|
|
181
|
+
formType: _types.FORM_TYPES.number,
|
|
182
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
183
|
+
group: _types.GROUPS.style,
|
|
184
|
+
defaultValue: 50,
|
|
185
|
+
editable: true,
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
bgColor: {
|
|
189
|
+
label: "Background Color",
|
|
190
|
+
description: "Background color",
|
|
191
|
+
formType: _types.FORM_TYPES.color,
|
|
192
|
+
propType: _types.PROP_TYPES.THEME,
|
|
193
|
+
editable: true,
|
|
194
|
+
required: false,
|
|
195
|
+
defaultValue: "light",
|
|
196
|
+
group: _types.GROUPS.style
|
|
197
|
+
}
|
|
106
198
|
}
|
|
107
199
|
}];
|
|
108
200
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SHARED_SEED_DATA = {
|
|
9
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
10
|
+
packageName: "native-base",
|
|
11
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS
|
|
12
|
+
};
|
|
13
|
+
const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = _types.CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== _types.StylesPanelSections.LayoutFlexItems && item !== _types.StylesPanelSections.LayoutContent);
|
|
14
|
+
const SEED_DATA = [{
|
|
15
|
+
name: "Aspect Ratio",
|
|
16
|
+
tag: "AspectRatio",
|
|
17
|
+
description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
|
|
18
|
+
...SHARED_SEED_DATA,
|
|
19
|
+
props: {
|
|
20
|
+
ratio: (0, _types.createStaticNumberProp)({
|
|
21
|
+
label: "Ratio",
|
|
22
|
+
description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
|
|
23
|
+
defaultValue: 1.33
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects]
|
|
27
|
+
}, {
|
|
28
|
+
name: "Box",
|
|
29
|
+
tag: "Box",
|
|
30
|
+
description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
|
|
31
|
+
...SHARED_SEED_DATA
|
|
32
|
+
}, {
|
|
33
|
+
name: "Center",
|
|
34
|
+
tag: "Center",
|
|
35
|
+
description: "Center aligns its contents to the center within itself",
|
|
36
|
+
...SHARED_SEED_DATA,
|
|
37
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
38
|
+
}, {
|
|
39
|
+
name: "Circle",
|
|
40
|
+
tag: "Circle",
|
|
41
|
+
description: "Center aligns its contents to the center within itself with a round border radius",
|
|
42
|
+
...SHARED_SEED_DATA,
|
|
43
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
44
|
+
}, {
|
|
45
|
+
name: "Container",
|
|
46
|
+
tag: "Container",
|
|
47
|
+
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
48
|
+
props: {
|
|
49
|
+
centerContent: (0, _types.createStaticBoolProp)({
|
|
50
|
+
label: "Center content",
|
|
51
|
+
description: "Center child elements based on their content width",
|
|
52
|
+
defaultValue: true
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
...SHARED_SEED_DATA
|
|
56
|
+
}, {
|
|
57
|
+
name: "Column",
|
|
58
|
+
tag: "Column",
|
|
59
|
+
description: "Column aligns items vertically",
|
|
60
|
+
layout: {
|
|
61
|
+
flexDirection: "column"
|
|
62
|
+
},
|
|
63
|
+
...SHARED_SEED_DATA
|
|
64
|
+
}, {
|
|
65
|
+
name: "Row",
|
|
66
|
+
tag: "Row",
|
|
67
|
+
description: "Column aligns items horizontally",
|
|
68
|
+
layout: {
|
|
69
|
+
flexDirection: "row"
|
|
70
|
+
},
|
|
71
|
+
...SHARED_SEED_DATA
|
|
72
|
+
}, {
|
|
73
|
+
name: "Spacer",
|
|
74
|
+
tag: "Spacer",
|
|
75
|
+
description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
|
|
76
|
+
layout: {
|
|
77
|
+
flex: 1
|
|
78
|
+
},
|
|
79
|
+
...SHARED_SEED_DATA,
|
|
80
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Margins]
|
|
81
|
+
}, {
|
|
82
|
+
name: "Stack",
|
|
83
|
+
tag: "Stack",
|
|
84
|
+
description: "Stack aligns items vertically or horizontally based on the direction prop",
|
|
85
|
+
...SHARED_SEED_DATA,
|
|
86
|
+
props: {
|
|
87
|
+
isDisabled: (0, _types.createBoolProp)({
|
|
88
|
+
label: "Disabled",
|
|
89
|
+
description: "If true, the Stack will be disabled"
|
|
90
|
+
}),
|
|
91
|
+
isInvalid: (0, _types.createBoolProp)({
|
|
92
|
+
label: "Invalid",
|
|
93
|
+
description: "If true, the Stack will be invalid"
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
name: "ZStack",
|
|
98
|
+
tag: "ZStack",
|
|
99
|
+
description: "ZStack aligns items to the z-axis",
|
|
100
|
+
...SHARED_SEED_DATA,
|
|
101
|
+
props: {
|
|
102
|
+
reversed: (0, _types.createBoolProp)({
|
|
103
|
+
label: "Reversed",
|
|
104
|
+
description: "Determines whether to reverse the direction of items"
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
}];
|
|
108
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, View, StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { generateBorderStyles, TableStyleContext } from "./TableCommon";
|
|
3
|
+
import { generateBorderStyles, TableStyleContext } from "./index";
|
|
5
4
|
const Table = _ref => {
|
|
6
5
|
let {
|
|
7
|
-
theme,
|
|
8
6
|
borderWidth = 1,
|
|
9
|
-
borderColor =
|
|
7
|
+
borderColor = "rgba(200, 200, 200, 1)",
|
|
10
8
|
borderStyle = "solid",
|
|
11
9
|
drawTopBorder = true,
|
|
12
10
|
drawBottomBorder = false,
|
|
@@ -111,4 +109,6 @@ const styles = StyleSheet.create({
|
|
|
111
109
|
flex: 1
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
|
-
export default
|
|
112
|
+
export default Table; }
|
|
113
|
+
});
|
|
114
|
+
export default 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 "./index";
|
|
4
4
|
const TableCell = _ref => {
|
|
5
5
|
let {
|
|
6
6
|
borderWidth,
|