@draftbit/core 46.10.3-106fd0.2 → 46.10.3-177666.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/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/module/components/Accordion/AccordionItem.js +25 -4
- 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/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/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/lib/commonjs/mappings/HeaderLarge.js +0 -34
- package/lib/commonjs/mappings/HeaderMedium.js +0 -60
- package/lib/commonjs/mappings/HeaderOverline.js +0 -60
- package/lib/module/mappings/HeaderLarge.js +0 -27
- package/lib/module/mappings/HeaderMedium.js +0 -53
- package/lib/module/mappings/HeaderOverline.js +0 -53
- package/lib/typescript/src/mappings/HeaderLarge.d.ts +0 -34
- package/lib/typescript/src/mappings/HeaderLarge.d.ts.map +0 -1
- package/lib/typescript/src/mappings/HeaderMedium.d.ts +0 -53
- package/lib/typescript/src/mappings/HeaderMedium.d.ts.map +0 -1
- package/lib/typescript/src/mappings/HeaderOverline.d.ts +0 -53
- package/lib/typescript/src/mappings/HeaderOverline.d.ts.map +0 -1
- package/src/mappings/HeaderLarge.js +0 -29
- package/src/mappings/HeaderLarge.ts +0 -38
- package/src/mappings/HeaderMedium.js +0 -55
- package/src/mappings/HeaderMedium.ts +0 -63
- package/src/mappings/HeaderOverline.js +0 -55
- package/src/mappings/HeaderOverline.ts +0 -63
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
9
|
+
var _theming = require("../../theming");
|
|
10
|
+
var _TableCommon = require("./TableCommon");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
const Table = _ref => {
|
|
12
13
|
let {
|
|
14
|
+
theme,
|
|
13
15
|
borderWidth = 1,
|
|
14
|
-
borderColor =
|
|
16
|
+
borderColor = theme.colors.divider,
|
|
15
17
|
borderStyle = "solid",
|
|
16
18
|
drawTopBorder = true,
|
|
17
19
|
drawBottomBorder = false,
|
|
@@ -96,7 +98,7 @@ const Table = _ref => {
|
|
|
96
98
|
cellHorizontalPadding,
|
|
97
99
|
cellVerticalPadding
|
|
98
100
|
};
|
|
99
|
-
const borderViewStyle = (0,
|
|
101
|
+
const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
|
|
100
102
|
borderColor,
|
|
101
103
|
borderWidth,
|
|
102
104
|
borderStyle,
|
|
@@ -105,18 +107,17 @@ const Table = _ref => {
|
|
|
105
107
|
drawStartBorder,
|
|
106
108
|
drawEndBorder
|
|
107
109
|
});
|
|
108
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_TableCommon.TableStyleContext.Provider, {
|
|
109
111
|
value: contextValue
|
|
110
112
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
111
113
|
style: [styles.container, borderViewStyle, style]
|
|
112
114
|
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, header), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, rest, childrenWithoutHeader)));
|
|
113
115
|
};
|
|
114
|
-
exports.Table = Table;
|
|
115
116
|
const styles = _reactNative.StyleSheet.create({
|
|
116
117
|
container: {
|
|
117
118
|
flex: 1
|
|
118
119
|
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
});
|
|
121
|
+
var _default = (0, _theming.withTheme)(Table);
|
|
122
|
+
exports.default = _default;
|
|
123
|
+
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 _TableCommon = require("./TableCommon");
|
|
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(_TableCommon.TableStyleContext);
|
|
26
|
+
const borderViewStyle = (0, _TableCommon.generateBorderStyles)({
|
|
27
27
|
borderColor: borderColor || parentContextValue.borderColor,
|
|
28
28
|
borderWidth: borderWidth || parentContextValue.borderWidth,
|
|
29
29
|
borderStyle: borderStyle || parentContextValue.borderStyle,
|
|
@@ -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
|
+
}
|
|
@@ -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 _TableCommon = require("./TableCommon");
|
|
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(_TableCommon.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, _TableCommon.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(_TableCommon.TableStyleContext.Provider, {
|
|
48
48
|
value: contextValue
|
|
49
49
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
50
|
style: [borderViewStyle, isTableHeader ? {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Table", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return _Table.
|
|
9
|
+
return _Table.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TableCell", {
|
|
@@ -21,31 +21,7 @@ Object.defineProperty(exports, "TableRow", {
|
|
|
21
21
|
return _TableRow.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
exports.generateBorderStyles = generateBorderStyles;
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
var _Table = require("./Table");
|
|
24
|
+
var _Table = _interopRequireDefault(require("./Table"));
|
|
28
25
|
var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
29
26
|
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
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
|
-
}
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,4 +1,3 @@
|
|
|
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); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
3
|
import Text from "../Text";
|
|
@@ -18,9 +17,10 @@ const AccordionItem = _ref => {
|
|
|
18
17
|
textStyles,
|
|
19
18
|
viewStyles
|
|
20
19
|
} = extractStyles(style);
|
|
21
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
22
|
-
style: [styles.container, viewStyles]
|
|
23
|
-
|
|
20
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
+
style: [styles.container, viewStyles],
|
|
22
|
+
...rest
|
|
23
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
24
24
|
style: styles.row
|
|
25
25
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
26
26
|
name: icon,
|
|
@@ -51,4 +51,25 @@ const styles = StyleSheet.create({
|
|
|
51
51
|
justifyContent: "center"
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
export default withTheme(AccordionItem);xtStyles
|
|
55
|
+
}, label))));
|
|
56
|
+
};
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
container: {
|
|
59
|
+
padding: 8
|
|
60
|
+
},
|
|
61
|
+
row: {
|
|
62
|
+
flexDirection: "row",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
paddingLeft: 8
|
|
65
|
+
},
|
|
66
|
+
item: {
|
|
67
|
+
marginVertical: 6,
|
|
68
|
+
paddingLeft: 8
|
|
69
|
+
},
|
|
70
|
+
content: {
|
|
71
|
+
flex: 1,
|
|
72
|
+
justifyContent: "center"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
54
75
|
export default withTheme(AccordionItem);
|
|
@@ -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 { View, StyleSheet } from "react-native";
|
|
3
4
|
const AspectRatio = props => {
|
|
@@ -26,24 +27,6 @@ const AspectRatio = props => {
|
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
30
|
-
...props,
|
|
31
|
-
style: style,
|
|
32
|
-
onLayout: _ref => {
|
|
33
|
-
let {
|
|
34
|
-
nativeEvent: {
|
|
35
|
-
layout: l
|
|
36
|
-
}
|
|
37
|
-
} = _ref;
|
|
38
|
-
return setLayout(l);
|
|
39
|
-
}
|
|
40
|
-
}, props.children);
|
|
41
|
-
};
|
|
42
|
-
export default AspectRatio;idth,
|
|
43
|
-
height: width * (1 / aspectRatio)
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
30
|
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
48
31
|
style: style,
|
|
49
32
|
onLayout: _ref => {
|
|
@@ -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 } from "react-native";
|
|
3
4
|
import { checkboxGroupContext, Direction } from "./context";
|
|
@@ -22,22 +23,7 @@ const CheckboxGroup = _ref => {
|
|
|
22
23
|
alignItems: "center"
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
-
style: [{
|
|
27
|
-
minHeight: 40
|
|
28
|
-
}, style],
|
|
29
|
-
...rest
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Provider, {
|
|
31
|
-
value: {
|
|
32
|
-
values,
|
|
33
|
-
onValueChange,
|
|
34
|
-
direction
|
|
35
|
-
}
|
|
36
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
37
|
-
style: _containerStyle
|
|
38
|
-
}, children)));
|
|
39
|
-
};
|
|
40
|
-
export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
|
|
26
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
41
27
|
style: [{
|
|
42
28
|
minHeight: 40
|
|
43
29
|
}, style]
|
|
@@ -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 { Image } from "react-native";
|
|
3
4
|
import Config from "./Config";
|
|
@@ -9,22 +10,6 @@ const CircleImage = _ref => {
|
|
|
9
10
|
...props
|
|
10
11
|
} = _ref;
|
|
11
12
|
const borderRadius = size / 2;
|
|
12
|
-
return /*#__PURE__*/React.createElement(Image, {
|
|
13
|
-
style: [{
|
|
14
|
-
width: size,
|
|
15
|
-
height: size,
|
|
16
|
-
borderRadius
|
|
17
|
-
}, style],
|
|
18
|
-
source: typeof source === "string" ? {
|
|
19
|
-
uri: source
|
|
20
|
-
} : source,
|
|
21
|
-
resizeMode: "cover",
|
|
22
|
-
...props
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export default CircleImage;props
|
|
26
|
-
} = _ref;
|
|
27
|
-
const borderRadius = size / 2;
|
|
28
13
|
return /*#__PURE__*/React.createElement(Image, _extends({
|
|
29
14
|
style: [{
|
|
30
15
|
width: size,
|
|
@@ -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,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"}
|