@draftbit/core 46.10.3-877a3f.2 → 46.10.3-a0279d.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/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +19 -7
- package/lib/commonjs/mappings/NativeBase/Layout.js +9 -14
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/module/components/DeprecatedFAB.js +3 -23
- package/lib/module/components/Elevation.js +2 -14
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/NativeBase/Layout.js +10 -15
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- 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 +14 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +16 -27
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Table.d.ts +337 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +1 -1
- package/src/index.tsx +2 -1
- package/src/mappings/NativeBase/Layout.js +19 -13
- package/src/mappings/NativeBase/Layout.ts +19 -13
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/Container.js +0 -93
- package/lib/commonjs/mappings/Container.js +0 -37
- package/lib/module/components/Container.js +0 -83
- package/lib/module/mappings/Container.js +0 -30
- package/lib/typescript/src/components/Container.d.ts +0 -21
- package/lib/typescript/src/components/Container.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Container.d.ts +0 -55
- package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
- package/src/components/Container.js +0 -43
- package/src/components/Container.tsx +0 -116
- package/src/mappings/Container.js +0 -30
- package/src/mappings/Container.ts +0 -41
|
@@ -13,8 +13,7 @@ var _utilities = require("../../utilities");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
|
|
17
|
-
let Direction;
|
|
16
|
+
var Direction;
|
|
18
17
|
exports.Direction = Direction;
|
|
19
18
|
(function (Direction) {
|
|
20
19
|
Direction["Row"] = "row";
|
|
@@ -72,13 +71,14 @@ const CheckboxGroupRow = _ref => {
|
|
|
72
71
|
textStyles,
|
|
73
72
|
viewStyles
|
|
74
73
|
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
74
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
76
75
|
onPress: handlePress,
|
|
77
76
|
style: [styles.mainParent, {
|
|
78
77
|
flexDirection: direction
|
|
79
78
|
}, viewStyles],
|
|
80
|
-
disabled: disabled
|
|
81
|
-
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
...rest
|
|
81
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
82
|
style: [styles.label, {
|
|
83
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
84
|
}, labelContainerStyle]
|
|
@@ -117,4 +117,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
var _default = CheckboxGroupRow;
|
|
120
|
+
exports.default = _default;center",
|
|
121
|
+
justifyContent: "space-around",
|
|
122
|
+
paddingStart: 20,
|
|
123
|
+
minHeight: 50,
|
|
124
|
+
paddingEnd: 20,
|
|
125
|
+
display: "flex",
|
|
126
|
+
..._reactNative.Platform.select({
|
|
127
|
+
web: {
|
|
128
|
+
cursor: "pointer",
|
|
129
|
+
userSelect: "none"
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
label: {
|
|
134
|
+
flex: 3
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var _default = CheckboxGroupRow;
|
|
120
138
|
exports.default = _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _theming = require("../../theming");
|
|
10
|
+
var _TableCommon = require("./TableCommon");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const Table = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
borderWidth = 1,
|
|
16
|
+
borderColor = theme.colors.divider,
|
|
17
|
+
borderStyle = "solid",
|
|
18
|
+
drawTopBorder = true,
|
|
19
|
+
drawBottomBorder = false,
|
|
20
|
+
drawStartBorder = false,
|
|
21
|
+
drawEndBorder = false,
|
|
22
|
+
cellVerticalPadding = 10,
|
|
23
|
+
cellHorizontalPadding = 10,
|
|
24
|
+
data,
|
|
25
|
+
keyExtractor,
|
|
26
|
+
renderItem,
|
|
27
|
+
children: childrenProp,
|
|
28
|
+
style,
|
|
29
|
+
...rest
|
|
30
|
+
} = _ref;
|
|
31
|
+
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
32
|
+
if (data && !renderItem || renderItem && !data) {
|
|
33
|
+
throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");
|
|
34
|
+
}
|
|
35
|
+
if (data && renderItem && childrenProp) {
|
|
36
|
+
console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");
|
|
37
|
+
}
|
|
38
|
+
const isTableHeader = _react.default.useCallback(object => {
|
|
39
|
+
return object.isTableHeader;
|
|
40
|
+
}, []);
|
|
41
|
+
const isRenderItem = data && renderItem;
|
|
42
|
+
|
|
43
|
+
//Uses 'renderItem' and 'data' to create an array of children
|
|
44
|
+
const dataAsChildren = _react.default.useMemo(() => {
|
|
45
|
+
if (!isRenderItem) return [];
|
|
46
|
+
return data.map((item, index) => {
|
|
47
|
+
const component = renderItem({
|
|
48
|
+
item,
|
|
49
|
+
index
|
|
50
|
+
});
|
|
51
|
+
if (!component) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const key = keyExtractor ? keyExtractor(item, index) : index.toString();
|
|
55
|
+
return /*#__PURE__*/_react.default.cloneElement(component, {
|
|
56
|
+
key
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}, [data, renderItem, keyExtractor, isRenderItem]);
|
|
60
|
+
const children = isRenderItem ? dataAsChildren : _react.default.Children.toArray(childrenProp);
|
|
61
|
+
const validChildren = _react.default.useMemo(() => children.filter(item => /*#__PURE__*/_react.default.isValidElement(item)), [children]);
|
|
62
|
+
const childrenWithoutHeader = _react.default.useMemo(() => {
|
|
63
|
+
const flattenedWithoutNestedHeaders = validChildren.map(item => {
|
|
64
|
+
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
65
|
+
//Header can be nested in React.Fragment when in renderItem
|
|
66
|
+
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
67
|
+
if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
|
|
68
|
+
//New element excluding header children
|
|
69
|
+
return /*#__PURE__*/_react.default.cloneElement(item, {
|
|
70
|
+
children: nestedChildren.filter(child => !isTableHeader(child.props))
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
return flattenedWithoutNestedHeaders.filter(item => !isTableHeader(item.props));
|
|
76
|
+
}, [validChildren, isTableHeader]);
|
|
77
|
+
const header = _react.default.useMemo(() => {
|
|
78
|
+
const flattenedPossibleHeaders = validChildren.map(item => {
|
|
79
|
+
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
80
|
+
//Header can be nested in React.Fragment when in renderItem
|
|
81
|
+
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
82
|
+
if (nestedHeaders !== null && nestedHeaders !== void 0 && nestedHeaders.length) {
|
|
83
|
+
return nestedHeaders[0];
|
|
84
|
+
}
|
|
85
|
+
return item;
|
|
86
|
+
});
|
|
87
|
+
const allHeaders = flattenedPossibleHeaders.filter(item => isTableHeader(item.props));
|
|
88
|
+
if (allHeaders.length) {
|
|
89
|
+
return allHeaders[0]; //Only 1 header taken
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return null;
|
|
93
|
+
}, [validChildren, isTableHeader]);
|
|
94
|
+
const contextValue = {
|
|
95
|
+
borderColor,
|
|
96
|
+
borderStyle,
|
|
97
|
+
borderWidth,
|
|
98
|
+
cellHorizontalPadding,
|
|
99
|
+
cellVerticalPadding
|
|
100
|
+
};
|
|
101
|
+
const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
|
|
102
|
+
borderColor,
|
|
103
|
+
borderWidth,
|
|
104
|
+
borderStyle,
|
|
105
|
+
drawTopBorder,
|
|
106
|
+
drawBottomBorder,
|
|
107
|
+
drawStartBorder,
|
|
108
|
+
drawEndBorder
|
|
109
|
+
});
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_TableCommon.TableStyleContext.Provider, {
|
|
111
|
+
value: contextValue
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
113
|
+
style: [styles.container, borderViewStyle, style]
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, header), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, rest, childrenWithoutHeader)));
|
|
115
|
+
};
|
|
116
|
+
const styles = _reactNative.StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
flex: 1
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var _default = (0, _theming.withTheme)(Table);
|
|
122
|
+
exports.default = _default;
|
|
123
|
+
exports.default = _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _TableCommon = require("./TableCommon");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const TableCell = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
borderWidth,
|
|
14
|
+
borderColor,
|
|
15
|
+
borderStyle,
|
|
16
|
+
drawTopBorder = false,
|
|
17
|
+
drawBottomBorder = false,
|
|
18
|
+
drawStartBorder = false,
|
|
19
|
+
drawEndBorder = true,
|
|
20
|
+
cellVerticalPadding,
|
|
21
|
+
cellHorizontalPadding,
|
|
22
|
+
children,
|
|
23
|
+
style
|
|
24
|
+
} = _ref;
|
|
25
|
+
const parentContextValue = _react.default.useContext(_TableCommon.TableStyleContext);
|
|
26
|
+
const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
|
|
27
|
+
borderColor: borderColor || parentContextValue.borderColor,
|
|
28
|
+
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
29
|
+
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
30
|
+
drawTopBorder,
|
|
31
|
+
drawBottomBorder,
|
|
32
|
+
drawStartBorder,
|
|
33
|
+
drawEndBorder
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
36
|
+
style: [styles.cellContainer, borderViewStyle, {
|
|
37
|
+
paddingVertical: cellVerticalPadding || parentContextValue.cellVerticalPadding,
|
|
38
|
+
paddingHorizontal: cellHorizontalPadding || parentContextValue.cellHorizontalPadding
|
|
39
|
+
}, style]
|
|
40
|
+
}, children);
|
|
41
|
+
};
|
|
42
|
+
const styles = _reactNative.StyleSheet.create({
|
|
43
|
+
cellContainer: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
flexDirection: "row"
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var _default = TableCell;
|
|
49
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableStyleContext = void 0;
|
|
7
|
+
exports.generateBorderStyles = generateBorderStyles;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const TableStyleContext = /*#__PURE__*/_react.default.createContext({});
|
|
11
|
+
exports.TableStyleContext = TableStyleContext;
|
|
12
|
+
function generateBorderStyles(_ref) {
|
|
13
|
+
let {
|
|
14
|
+
borderColor,
|
|
15
|
+
borderWidth,
|
|
16
|
+
borderStyle,
|
|
17
|
+
drawTopBorder,
|
|
18
|
+
drawBottomBorder,
|
|
19
|
+
drawStartBorder,
|
|
20
|
+
drawEndBorder
|
|
21
|
+
} = _ref;
|
|
22
|
+
return {
|
|
23
|
+
borderColor,
|
|
24
|
+
borderStyle,
|
|
25
|
+
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
26
|
+
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
27
|
+
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
28
|
+
borderEndWidth: drawEndBorder ? borderWidth : 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _TableCommon = require("./TableCommon");
|
|
10
|
+
var _theming = require("../../theming");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const TableRow = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
borderWidth,
|
|
15
|
+
borderColor,
|
|
16
|
+
borderStyle,
|
|
17
|
+
drawTopBorder = false,
|
|
18
|
+
drawBottomBorder = true,
|
|
19
|
+
drawStartBorder = true,
|
|
20
|
+
drawEndBorder = false,
|
|
21
|
+
cellVerticalPadding,
|
|
22
|
+
cellHorizontalPadding,
|
|
23
|
+
isTableHeader = false,
|
|
24
|
+
children,
|
|
25
|
+
style,
|
|
26
|
+
theme
|
|
27
|
+
} = _ref;
|
|
28
|
+
const parentContextValue = _react.default.useContext(_TableCommon.TableStyleContext);
|
|
29
|
+
|
|
30
|
+
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
31
|
+
const contextValue = {
|
|
32
|
+
borderColor: borderColor || parentContextValue.borderColor,
|
|
33
|
+
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
34
|
+
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
35
|
+
cellHorizontalPadding: cellHorizontalPadding || parentContextValue.cellHorizontalPadding,
|
|
36
|
+
cellVerticalPadding: cellVerticalPadding || parentContextValue.cellVerticalPadding
|
|
37
|
+
};
|
|
38
|
+
const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
|
|
39
|
+
borderColor: contextValue.borderColor,
|
|
40
|
+
borderWidth: contextValue.borderWidth,
|
|
41
|
+
borderStyle: contextValue.borderStyle,
|
|
42
|
+
drawTopBorder,
|
|
43
|
+
drawBottomBorder,
|
|
44
|
+
drawStartBorder,
|
|
45
|
+
drawEndBorder
|
|
46
|
+
});
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_TableCommon.TableStyleContext.Provider, {
|
|
48
|
+
value: contextValue
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
|
+
style: [borderViewStyle, isTableHeader ? {
|
|
51
|
+
backgroundColor: theme.colors.primary
|
|
52
|
+
} : {}, style, styles.cellsContainer]
|
|
53
|
+
}, children));
|
|
54
|
+
};
|
|
55
|
+
const styles = _reactNative.StyleSheet.create({
|
|
56
|
+
cellsContainer: {
|
|
57
|
+
flexDirection: "row"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var _default = (0, _theming.withTheme)(TableRow);
|
|
61
|
+
exports.default = _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Table", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Table.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TableCell", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _TableCell.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TableRow", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _TableRow.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _Table = _interopRequireDefault(require("./Table"));
|
|
25
|
+
var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
26
|
+
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -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;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -117,12 +117,6 @@ Object.defineProperty(exports, "CircleImage", {
|
|
|
117
117
|
return _CircleImage.default;
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
|
-
Object.defineProperty(exports, "Container", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _Container.default;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
120
|
Object.defineProperty(exports, "DatePicker", {
|
|
127
121
|
enumerable: true,
|
|
128
122
|
get: function () {
|
|
@@ -351,6 +345,24 @@ Object.defineProperty(exports, "TabViewItem", {
|
|
|
351
345
|
return _TabView.TabViewItem;
|
|
352
346
|
}
|
|
353
347
|
});
|
|
348
|
+
Object.defineProperty(exports, "Table", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () {
|
|
351
|
+
return _Table.Table;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(exports, "TableCell", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function () {
|
|
357
|
+
return _Table.TableCell;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(exports, "TableRow", {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
get: function () {
|
|
363
|
+
return _Table.TableRow;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
354
366
|
Object.defineProperty(exports, "TextField", {
|
|
355
367
|
enumerable: true,
|
|
356
368
|
get: function () {
|
|
@@ -410,7 +422,6 @@ var _CircleImage = _interopRequireDefault(require("./components/CircleImage"));
|
|
|
410
422
|
var _AvatarEdit = _interopRequireDefault(require("./components/AvatarEdit"));
|
|
411
423
|
var _Card = _interopRequireDefault(require("./components/Card"));
|
|
412
424
|
var _Checkbox = require("./components/Checkbox");
|
|
413
|
-
var _Container = _interopRequireDefault(require("./components/Container"));
|
|
414
425
|
var _Divider = _interopRequireDefault(require("./components/Divider"));
|
|
415
426
|
var _FAB = _interopRequireDefault(require("./components/FAB"));
|
|
416
427
|
var _FieldSearchBarFull = _interopRequireDefault(require("./components/FieldSearchBarFull"));
|
|
@@ -437,6 +448,7 @@ var _TabView = require("./components/TabView");
|
|
|
437
448
|
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
438
449
|
var _BottomSheet = require("./components/BottomSheet");
|
|
439
450
|
var _YoutubePlayer = require("./components/YoutubePlayer");
|
|
451
|
+
var _Table = require("./components/Table");
|
|
440
452
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
441
453
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
442
454
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -22,7 +22,8 @@ const SEED_DATA = [{
|
|
|
22
22
|
description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
|
|
23
23
|
defaultValue: 1.33
|
|
24
24
|
})
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects]
|
|
26
27
|
}, {
|
|
27
28
|
name: "Box",
|
|
28
29
|
tag: "Box",
|
|
@@ -45,9 +46,10 @@ const SEED_DATA = [{
|
|
|
45
46
|
tag: "Container",
|
|
46
47
|
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
47
48
|
props: {
|
|
48
|
-
centerContent: (0, _types.
|
|
49
|
+
centerContent: (0, _types.createStaticBoolProp)({
|
|
49
50
|
label: "Center content",
|
|
50
|
-
description: "Center child elements based on their content width"
|
|
51
|
+
description: "Center child elements based on their content width",
|
|
52
|
+
defaultValue: true
|
|
51
53
|
})
|
|
52
54
|
},
|
|
53
55
|
...SHARED_SEED_DATA
|
|
@@ -71,24 +73,17 @@ const SEED_DATA = [{
|
|
|
71
73
|
name: "Spacer",
|
|
72
74
|
tag: "Spacer",
|
|
73
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
|
+
},
|
|
74
79
|
...SHARED_SEED_DATA,
|
|
75
|
-
stylesPanelSections:
|
|
80
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Margins]
|
|
76
81
|
}, {
|
|
77
82
|
name: "Stack",
|
|
78
83
|
tag: "Stack",
|
|
79
84
|
description: "Stack aligns items vertically or horizontally based on the direction prop",
|
|
80
85
|
...SHARED_SEED_DATA,
|
|
81
86
|
props: {
|
|
82
|
-
direction: (0, _types.createTextEnumProp)({
|
|
83
|
-
label: "Direction",
|
|
84
|
-
description: "The direction of the Stack",
|
|
85
|
-
options: ["row", "column"],
|
|
86
|
-
defaultValue: "column"
|
|
87
|
-
}),
|
|
88
|
-
reversed: (0, _types.createBoolProp)({
|
|
89
|
-
label: "Reversed",
|
|
90
|
-
description: "Determines whether to reverse the direction of items"
|
|
91
|
-
}),
|
|
92
87
|
isDisabled: (0, _types.createBoolProp)({
|
|
93
88
|
label: "Disabled",
|
|
94
89
|
description: "If true, the Stack will be disabled"
|
|
@@ -0,0 +1,140 @@
|
|
|
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_PROPS = {
|
|
9
|
+
borderWidth: (0, _types.createStaticNumberProp)({
|
|
10
|
+
label: "Border Width",
|
|
11
|
+
description: "Specifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
12
|
+
required: false,
|
|
13
|
+
defaultValue: null
|
|
14
|
+
}),
|
|
15
|
+
borderColor: (0, _types.createColorProp)({
|
|
16
|
+
label: "Border Color",
|
|
17
|
+
description: "Specifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
18
|
+
defaultValue: null
|
|
19
|
+
}),
|
|
20
|
+
borderStyle: (0, _types.createTextEnumProp)({
|
|
21
|
+
label: "Border Style",
|
|
22
|
+
description: "Specifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden",
|
|
23
|
+
options: ["solid", "dotted", "dashed"],
|
|
24
|
+
defaultValue: null
|
|
25
|
+
}),
|
|
26
|
+
drawTopBorder: (0, _types.createStaticBoolProp)({
|
|
27
|
+
label: "Draw Top Border",
|
|
28
|
+
description: "Whether to draw the top border at this layer of the Table tree or not",
|
|
29
|
+
defaultValue: false
|
|
30
|
+
}),
|
|
31
|
+
drawBottomBorder: (0, _types.createStaticBoolProp)({
|
|
32
|
+
label: "Draw Bottom Border",
|
|
33
|
+
description: "Whether to draw the bottom border at this layer of the Table tree or not",
|
|
34
|
+
defaultValue: false
|
|
35
|
+
}),
|
|
36
|
+
drawStartBorder: (0, _types.createStaticBoolProp)({
|
|
37
|
+
label: "Draw Start Border",
|
|
38
|
+
description: "Whether to draw the start border at this layer of the Table tree or not",
|
|
39
|
+
defaultValue: false
|
|
40
|
+
}),
|
|
41
|
+
drawEndBorder: (0, _types.createStaticBoolProp)({
|
|
42
|
+
label: "Draw End Border",
|
|
43
|
+
description: "Whether to draw the end border at this layer of the Table tree or not",
|
|
44
|
+
defaultValue: false
|
|
45
|
+
}),
|
|
46
|
+
cellVerticalPadding: (0, _types.createStaticNumberProp)({
|
|
47
|
+
label: "Cell Vertical Padding",
|
|
48
|
+
description: "Specifies the vertical padding of the cell. Passed down to TableCell components unless overridden",
|
|
49
|
+
required: false,
|
|
50
|
+
defaultValue: null
|
|
51
|
+
}),
|
|
52
|
+
cellHorizontalPadding: (0, _types.createStaticNumberProp)({
|
|
53
|
+
label: "Cell Horizontal Padding",
|
|
54
|
+
description: "Specifies the horizontal padding of the cell. Passed down to TableCell components unless overridden",
|
|
55
|
+
required: false,
|
|
56
|
+
defaultValue: null
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
const SEED_DATA = [{
|
|
60
|
+
name: "Table",
|
|
61
|
+
tag: "Table",
|
|
62
|
+
description: "Top level table container",
|
|
63
|
+
category: _types.COMPONENT_TYPES.table,
|
|
64
|
+
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects, _types.StylesPanelSections.Background, _types.StylesPanelSections.LayoutSelectedItem],
|
|
65
|
+
layout: {
|
|
66
|
+
flex: 1
|
|
67
|
+
},
|
|
68
|
+
props: {
|
|
69
|
+
...SHARED_SEED_DATA_PROPS,
|
|
70
|
+
borderWidth: {
|
|
71
|
+
...SHARED_SEED_DATA_PROPS.borderWidth,
|
|
72
|
+
defaultValue: 1
|
|
73
|
+
},
|
|
74
|
+
borderColor: {
|
|
75
|
+
...SHARED_SEED_DATA_PROPS.borderColor,
|
|
76
|
+
defaultValue: "divider"
|
|
77
|
+
},
|
|
78
|
+
borderStyle: {
|
|
79
|
+
...SHARED_SEED_DATA_PROPS.borderStyle,
|
|
80
|
+
defaultValue: "solid"
|
|
81
|
+
},
|
|
82
|
+
drawTopBorder: {
|
|
83
|
+
...SHARED_SEED_DATA_PROPS.drawTopBorder,
|
|
84
|
+
defaultValue: true
|
|
85
|
+
},
|
|
86
|
+
cellVerticalPadding: {
|
|
87
|
+
...SHARED_SEED_DATA_PROPS.cellVerticalPadding,
|
|
88
|
+
defaultValue: 10
|
|
89
|
+
},
|
|
90
|
+
cellHorizontalPadding: {
|
|
91
|
+
...SHARED_SEED_DATA_PROPS.cellHorizontalPadding,
|
|
92
|
+
defaultValue: 10
|
|
93
|
+
},
|
|
94
|
+
showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
|
|
95
|
+
label: "Show Vertical Scroll Indicator",
|
|
96
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
97
|
+
defaultValue: true
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
name: "Table Row",
|
|
102
|
+
tag: "TableRow",
|
|
103
|
+
description: "Table Row container",
|
|
104
|
+
category: _types.COMPONENT_TYPES.table,
|
|
105
|
+
stylesPanelSections: [_types.StylesPanelSections.Background],
|
|
106
|
+
props: {
|
|
107
|
+
...SHARED_SEED_DATA_PROPS,
|
|
108
|
+
drawStartBorder: {
|
|
109
|
+
...SHARED_SEED_DATA_PROPS.drawStartBorder,
|
|
110
|
+
defaultValue: true
|
|
111
|
+
},
|
|
112
|
+
drawBottomBorder: {
|
|
113
|
+
...SHARED_SEED_DATA_PROPS.drawBottomBorder,
|
|
114
|
+
defaultValue: true
|
|
115
|
+
},
|
|
116
|
+
isTableHeader: (0, _types.createStaticBoolProp)({
|
|
117
|
+
label: "Header",
|
|
118
|
+
description: "Whether this row is a header or not (changes background and sticks while scrolling)",
|
|
119
|
+
defaultValue: false
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
name: "Table Cell",
|
|
124
|
+
tag: "TableCell",
|
|
125
|
+
description: "Table Cell container",
|
|
126
|
+
category: _types.COMPONENT_TYPES.table,
|
|
127
|
+
stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
128
|
+
layout: {
|
|
129
|
+
flex: 1,
|
|
130
|
+
flexDirection: "row"
|
|
131
|
+
},
|
|
132
|
+
props: {
|
|
133
|
+
...SHARED_SEED_DATA_PROPS,
|
|
134
|
+
drawEndBorder: {
|
|
135
|
+
...SHARED_SEED_DATA_PROPS.drawEndBorder,
|
|
136
|
+
defaultValue: true
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}];
|
|
140
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -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, StyleSheet, Pressable } from "react-native";
|
|
3
4
|
import color from "color";
|
|
@@ -96,8 +97,7 @@ const FAB = _ref => {
|
|
|
96
97
|
style: [{
|
|
97
98
|
elevation
|
|
98
99
|
}, style]
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
100
|
-
...rest,
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
101
101
|
onPress: onPress,
|
|
102
102
|
accessibilityState: {
|
|
103
103
|
disabled
|
|
@@ -105,7 +105,7 @@ const FAB = _ref => {
|
|
|
105
105
|
accessibilityRole: "button",
|
|
106
106
|
disabled: disabled || loading,
|
|
107
107
|
style: buttonStyles
|
|
108
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
109
109
|
style: styles.content
|
|
110
110
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
111
|
style: iconStyle
|
|
@@ -144,24 +144,4 @@ const styles = StyleSheet.create({
|
|
|
144
144
|
borderRadius: 0
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
|
-
export default withTheme(FAB);le: "solid"
|
|
148
|
-
},
|
|
149
|
-
content: {
|
|
150
|
-
flexDirection: "row",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
justifyContent: "center"
|
|
153
|
-
},
|
|
154
|
-
icon: {
|
|
155
|
-
alignItems: "center",
|
|
156
|
-
justifyContent: "center",
|
|
157
|
-
width: Config.buttonIconSize
|
|
158
|
-
},
|
|
159
|
-
fixed: {
|
|
160
|
-
left: 0,
|
|
161
|
-
right: 0,
|
|
162
|
-
bottom: 0,
|
|
163
|
-
height: 64,
|
|
164
|
-
borderRadius: 0
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
147
|
export default withTheme(FAB);
|
|
@@ -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 { Animated, StyleSheet, View } from "react-native";
|
|
3
4
|
import shadow from "../styles/shadow";
|
|
@@ -18,20 +19,7 @@ const Elevation = _ref => {
|
|
|
18
19
|
colors
|
|
19
20
|
} = theme;
|
|
20
21
|
const borderRadius = radius;
|
|
21
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
22
|
-
...rest,
|
|
23
|
-
style: [{
|
|
24
|
-
borderRadius,
|
|
25
|
-
backgroundColor: colors.surface
|
|
26
|
-
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
-
style: {
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
borderRadius
|
|
31
|
-
}
|
|
32
|
-
}, children));
|
|
33
|
-
};
|
|
34
|
-
export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
|
|
22
|
+
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
35
23
|
style: [{
|
|
36
24
|
borderRadius,
|
|
37
25
|
backgroundColor: colors.surface
|