@draftbit/core 46.10.3-c96e98.2 → 46.10.3-cf3748.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 +5 -23
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/Table/Table.js +3 -3
- 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/module/components/Table/Table.js +1 -1
- 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/typescript/src/components/Table/Table.d.ts +1 -1
- 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/package.json +3 -3
- package/src/components/Table/Table.js +1 -1
- package/src/components/Table/Table.tsx +1 -1
- 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/lib/commonjs/components/DeprecatedCardWrapper.js +0 -40
- package/lib/commonjs/components/DeprecatedFAB.js +0 -157
- package/lib/commonjs/components/ProgressIndicator.js +0 -55
- package/lib/commonjs/components/ResizeMode.js +0 -5
- package/lib/commonjs/components/Table/TableCommon.js +0 -30
- package/lib/commonjs/mappings/CardBlock.js +0 -126
- package/lib/commonjs/mappings/CardContainer.js +0 -108
- package/lib/commonjs/mappings/CardContainerRating.js +0 -130
- package/lib/commonjs/mappings/CardContainerShortImage.js +0 -124
- package/lib/commonjs/mappings/CardInline.js +0 -59
- package/lib/commonjs/mappings/ProgressIndicator.js +0 -188
- package/lib/module/components/DeprecatedCardWrapper.js +0 -32
- package/lib/module/components/DeprecatedFAB.js +0 -147
- package/lib/module/components/ProgressIndicator.js +0 -45
- package/lib/module/components/ResizeMode.js +0 -1
- package/lib/module/components/Table/TableCommon.js +0 -21
- package/lib/module/mappings/CardBlock.js +0 -119
- package/lib/module/mappings/CardContainer.js +0 -101
- package/lib/module/mappings/CardContainerRating.js +0 -123
- package/lib/module/mappings/CardContainerShortImage.js +0 -117
- package/lib/module/mappings/CardInline.js +0 -52
- package/lib/module/mappings/ProgressIndicator.js +0 -181
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +0 -15
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +0 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +0 -56
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +0 -1
- package/lib/typescript/src/components/ProgressIndicator.d.ts +0 -24
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +0 -1
- package/lib/typescript/src/components/ResizeMode.d.ts +0 -2
- package/lib/typescript/src/components/ResizeMode.d.ts.map +0 -1
- package/lib/typescript/src/components/Table/TableCommon.d.ts +0 -20
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardBlock.d.ts +0 -289
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainer.d.ts +0 -102
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +0 -108
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +0 -139
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardInline.d.ts +0 -62
- package/lib/typescript/src/mappings/CardInline.d.ts.map +0 -1
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +0 -181
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +0 -1
- package/src/components/DeprecatedCardWrapper.js +0 -18
- package/src/components/DeprecatedCardWrapper.tsx +0 -46
- package/src/components/DeprecatedFAB.js +0 -114
- package/src/components/DeprecatedFAB.tsx +0 -231
- package/src/components/ProgressIndicator.js +0 -27
- package/src/components/ProgressIndicator.tsx +0 -71
- package/src/components/ResizeMode.js +0 -1
- package/src/components/ResizeMode.ts +0 -7
- package/src/components/Table/TableCommon.js +0 -12
- package/src/components/Table/TableCommon.ts +0 -40
- package/src/mappings/CardBlock.js +0 -123
- package/src/mappings/CardBlock.ts +0 -136
- package/src/mappings/CardContainer.js +0 -104
- package/src/mappings/CardContainer.ts +0 -116
- package/src/mappings/CardContainerRating.js +0 -126
- package/src/mappings/CardContainerRating.ts +0 -137
- package/src/mappings/CardContainerShortImage.js +0 -120
- package/src/mappings/CardContainerShortImage.ts +0 -130
- package/src/mappings/CardInline.js +0 -52
- package/src/mappings/CardInline.ts +0 -61
- package/src/mappings/ProgressIndicator.js +0 -181
- package/src/mappings/ProgressIndicator.ts +0 -190
|
@@ -13,7 +13,8 @@ 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
|
-
var
|
|
16
|
+
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); }
|
|
17
|
+
let Direction;
|
|
17
18
|
exports.Direction = Direction;
|
|
18
19
|
(function (Direction) {
|
|
19
20
|
Direction["Row"] = "row";
|
|
@@ -71,14 +72,13 @@ const CheckboxGroupRow = _ref => {
|
|
|
71
72
|
textStyles,
|
|
72
73
|
viewStyles
|
|
73
74
|
} = (0, _utilities.extractStyles)(style);
|
|
74
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
75
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
75
76
|
onPress: handlePress,
|
|
76
77
|
style: [styles.mainParent, {
|
|
77
78
|
flexDirection: direction
|
|
78
79
|
}, viewStyles],
|
|
79
|
-
disabled: disabled
|
|
80
|
-
|
|
81
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
80
|
+
disabled: disabled
|
|
81
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
82
|
style: [styles.label, {
|
|
83
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
84
|
}, labelContainerStyle]
|
|
@@ -117,22 +117,4 @@ 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;
|
|
138
120
|
exports.default = _default;
|
|
@@ -14,7 +14,8 @@ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
17
|
-
var
|
|
17
|
+
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); }
|
|
18
|
+
let Direction;
|
|
18
19
|
exports.Direction = Direction;
|
|
19
20
|
(function (Direction) {
|
|
20
21
|
Direction["Row"] = "row";
|
|
@@ -57,6 +58,7 @@ const CheckboxRow = _ref => {
|
|
|
57
58
|
setInternalValue(status);
|
|
58
59
|
}
|
|
59
60
|
}, [status]);
|
|
61
|
+
|
|
60
62
|
// This special logic is to handle weird APIs like Airtable that return
|
|
61
63
|
// true or undefined for a boolean
|
|
62
64
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -80,14 +82,13 @@ const CheckboxRow = _ref => {
|
|
|
80
82
|
textStyles,
|
|
81
83
|
viewStyles
|
|
82
84
|
} = (0, _utilities.extractStyles)(style);
|
|
83
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
85
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
84
86
|
onPress: handlePress,
|
|
85
87
|
style: [viewStyles, styles.mainParent, {
|
|
86
88
|
flexDirection: direction
|
|
87
89
|
}],
|
|
88
|
-
disabled: disabled
|
|
89
|
-
|
|
90
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
90
|
+
disabled: disabled
|
|
91
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
91
92
|
style: [styles.label, {
|
|
92
93
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
93
94
|
}, labelContainerStyle]
|
|
@@ -124,22 +125,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
124
125
|
}
|
|
125
126
|
});
|
|
126
127
|
var _default = CheckboxRow;
|
|
127
|
-
exports.default = _default;ems: "center",
|
|
128
|
-
justifyContent: "space-around",
|
|
129
|
-
paddingStart: 20,
|
|
130
|
-
minHeight: 50,
|
|
131
|
-
paddingEnd: 20,
|
|
132
|
-
display: "flex",
|
|
133
|
-
..._reactNative.Platform.select({
|
|
134
|
-
web: {
|
|
135
|
-
cursor: "pointer",
|
|
136
|
-
userSelect: "none"
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
},
|
|
140
|
-
label: {
|
|
141
|
-
flex: 3
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
var _default = CheckboxRow;
|
|
145
128
|
exports.default = _default;
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _theming = require("../../theming");
|
|
10
|
-
var
|
|
10
|
+
var _index = require("./index");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const Table = _ref => {
|
|
13
13
|
let {
|
|
@@ -98,7 +98,7 @@ const Table = _ref => {
|
|
|
98
98
|
cellHorizontalPadding,
|
|
99
99
|
cellVerticalPadding
|
|
100
100
|
};
|
|
101
|
-
const borderViewStyle = (0,
|
|
101
|
+
const borderViewStyle = (0, _index.generateBorderStyles)({
|
|
102
102
|
borderColor,
|
|
103
103
|
borderWidth,
|
|
104
104
|
borderStyle,
|
|
@@ -107,7 +107,7 @@ const Table = _ref => {
|
|
|
107
107
|
drawStartBorder,
|
|
108
108
|
drawEndBorder
|
|
109
109
|
});
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_index.TableStyleContext.Provider, {
|
|
111
111
|
value: contextValue
|
|
112
112
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
113
113
|
style: [styles.container, borderViewStyle, style]
|
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, View, StyleSheet } from "react-native";
|
|
3
3
|
import { withTheme } from "../../theming";
|
|
4
|
-
import { generateBorderStyles, TableStyleContext } from "./
|
|
4
|
+
import { generateBorderStyles, TableStyleContext } from "./index";
|
|
5
5
|
const Table = _ref => {
|
|
6
6
|
let {
|
|
7
7
|
theme,
|
|
@@ -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,
|
|
@@ -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
|
import { withTheme } from "../../theming";
|
|
5
5
|
const TableRow = _ref => {
|
|
6
6
|
let {
|
|
@@ -1,3 +1,24 @@
|
|
|
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
22
|
export { default as Table } from "./Table";
|
|
2
23
|
export { default as TableRow } from "./TableRow";
|
|
3
24
|
export { default as TableCell } from "./TableCell";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, ScrollViewProps } from "react-native";
|
|
3
3
|
import { Theme } from "../../styles/DefaultTheme";
|
|
4
|
-
import { TableProps } from "./
|
|
4
|
+
import { TableProps } from "./index";
|
|
5
5
|
export interface Props<T> extends TableProps, ScrollViewProps {
|
|
6
6
|
data?: Array<T>;
|
|
7
7
|
keyExtractor?: (item: T, index: number) => string;
|
|
@@ -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,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,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,SAAS,CAAC;AAEjB,MAAM,WAAW,KAAK,CAAC,CAAC,CAAE,SAAQ,UAAU,EAAE,eAAe;IAC3D,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AAuJD,wBAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,EAAwB,UAAU,EAAqB,MAAM,SAAS,CAAC;AAE9E,MAAM,WAAW,KAAM,SAAQ,UAAU;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAyCvD,CAAC;AASF,eAAe,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { TableProps } from "./
|
|
3
|
+
import { TableProps } from "./index";
|
|
4
4
|
import { Theme } from "../../styles/DefaultTheme";
|
|
5
5
|
export interface Props extends TableProps {
|
|
6
6
|
isTableHeader?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,EAEL,UAAU,EAGX,MAAM,
|
|
1
|
+
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,EAEL,UAAU,EAGX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGlD,MAAM,WAAW,KAAM,SAAQ,UAAU;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AA6DD,wBAAmC"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
declare type BorderStyle = "solid" | "dotted" | "dashed";
|
|
4
|
+
export declare const TableStyleContext: React.Context<TableStyleProps>;
|
|
5
|
+
export interface TableStyleProps {
|
|
6
|
+
borderWidth?: number;
|
|
7
|
+
borderColor?: string;
|
|
8
|
+
borderStyle?: BorderStyle;
|
|
9
|
+
cellVerticalPadding?: number;
|
|
10
|
+
cellHorizontalPadding?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TableProps extends TableStyleProps {
|
|
13
|
+
drawTopBorder?: boolean;
|
|
14
|
+
drawBottomBorder?: boolean;
|
|
15
|
+
drawStartBorder?: boolean;
|
|
16
|
+
drawEndBorder?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function generateBorderStyles({ borderColor, borderWidth, borderStyle, drawTopBorder, drawBottomBorder, drawStartBorder, drawEndBorder, }: TableProps): ViewStyle;
|
|
1
19
|
export { default as Table } from "./Table";
|
|
2
20
|
export { default as TableRow } from "./TableRow";
|
|
3
21
|
export { default as TableCell } from "./TableCell";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,aAAK,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjD,eAAO,MAAM,iBAAiB,gCAA2C,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,EAAE,UAAU,GAAG,SAAS,CASxB;AAED,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.10.3-
|
|
3
|
+
"version": "46.10.3-cf3748.2+cf37488",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.10.3-
|
|
44
|
+
"@draftbit/types": "^46.10.3-cf3748.2+cf37488",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "cf37488982c9f617ee126da24adba23bcab663dc"
|
|
104
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, View, StyleSheet, } from "react-native";
|
|
3
3
|
import { withTheme } from "../../theming";
|
|
4
|
-
import { generateBorderStyles, TableStyleContext, } from "./
|
|
4
|
+
import { generateBorderStyles, TableStyleContext, } from "./index";
|
|
5
5
|
const Table = ({ theme, borderWidth = 1, borderColor = theme.colors.divider, borderStyle = "solid", drawTopBorder = true, drawBottomBorder = false, drawStartBorder = false, drawEndBorder = false, cellVerticalPadding = 10, cellHorizontalPadding = 10, data, keyExtractor, renderItem, children: childrenProp, style, ...rest }) => {
|
|
6
6
|
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
7
7
|
if ((data && !renderItem) || (renderItem && !data)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { generateBorderStyles, TableStyleContext
|
|
3
|
+
import { generateBorderStyles, TableStyleContext } from "./index";
|
|
4
4
|
const TableCell = ({ borderWidth, borderColor, borderStyle, drawTopBorder = false, drawBottomBorder = false, drawStartBorder = false, drawEndBorder = true, cellVerticalPadding, cellHorizontalPadding, children, style, }) => {
|
|
5
5
|
const parentContextValue = React.useContext(TableStyleContext);
|
|
6
6
|
const borderViewStyle = generateBorderStyles({
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
generateBorderStyles,
|
|
5
|
-
TableProps,
|
|
6
|
-
TableStyleContext,
|
|
7
|
-
} from "./TableCommon";
|
|
3
|
+
import { generateBorderStyles, TableProps, TableStyleContext } from "./index";
|
|
8
4
|
|
|
9
5
|
export interface Props extends TableProps {
|
|
10
6
|
style?: StyleProp<ViewStyle>;
|
|
@@ -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
|
import { withTheme } from "../../theming";
|
|
5
5
|
const TableRow = ({ borderWidth, borderColor, borderStyle, drawTopBorder = false, drawBottomBorder = true, drawStartBorder = true, drawEndBorder = false, cellVerticalPadding, cellHorizontalPadding, isTableHeader = false, children, style, theme, }) => {
|
|
6
6
|
const parentContextValue = React.useContext(TableStyleContext);
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const TableStyleContext = React.createContext({});
|
|
3
|
+
export function generateBorderStyles({ borderColor, borderWidth, borderStyle, drawTopBorder, drawBottomBorder, drawStartBorder, drawEndBorder, }) {
|
|
4
|
+
return {
|
|
5
|
+
borderColor,
|
|
6
|
+
borderStyle,
|
|
7
|
+
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
8
|
+
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
9
|
+
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
10
|
+
borderEndWidth: drawEndBorder ? borderWidth : 0,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
1
13
|
export { default as Table } from "./Table";
|
|
2
14
|
export { default as TableRow } from "./TableRow";
|
|
3
15
|
export { default as TableCell } from "./TableCell";
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
type BorderStyle = "solid" | "dotted" | "dashed";
|
|
5
|
+
|
|
6
|
+
export const TableStyleContext = React.createContext<TableStyleProps>({});
|
|
7
|
+
|
|
8
|
+
export interface TableStyleProps {
|
|
9
|
+
borderWidth?: number;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
borderStyle?: BorderStyle;
|
|
12
|
+
cellVerticalPadding?: number;
|
|
13
|
+
cellHorizontalPadding?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface TableProps extends TableStyleProps {
|
|
17
|
+
drawTopBorder?: boolean;
|
|
18
|
+
drawBottomBorder?: boolean;
|
|
19
|
+
drawStartBorder?: boolean;
|
|
20
|
+
drawEndBorder?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function generateBorderStyles({
|
|
24
|
+
borderColor,
|
|
25
|
+
borderWidth,
|
|
26
|
+
borderStyle,
|
|
27
|
+
drawTopBorder,
|
|
28
|
+
drawBottomBorder,
|
|
29
|
+
drawStartBorder,
|
|
30
|
+
drawEndBorder,
|
|
31
|
+
}: TableProps): ViewStyle {
|
|
32
|
+
return {
|
|
33
|
+
borderColor,
|
|
34
|
+
borderStyle,
|
|
35
|
+
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
36
|
+
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
37
|
+
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
38
|
+
borderEndWidth: drawEndBorder ? borderWidth : 0,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
1
42
|
export { default as Table } from "./Table";
|
|
2
43
|
export { default as TableRow } from "./TableRow";
|
|
3
44
|
export { default as TableCell } from "./TableCell";
|
|
@@ -1,40 +0,0 @@
|
|
|
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 _theming = require("../theming");
|
|
9
|
-
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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
|
-
const getWidth = numColumns => {
|
|
13
|
-
switch (numColumns) {
|
|
14
|
-
case 1:
|
|
15
|
-
return "33%";
|
|
16
|
-
case 2:
|
|
17
|
-
return "50%";
|
|
18
|
-
default:
|
|
19
|
-
return "100%";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const Card = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
numColumns = 3,
|
|
25
|
-
children,
|
|
26
|
-
onPress,
|
|
27
|
-
style,
|
|
28
|
-
...rest
|
|
29
|
-
} = _ref;
|
|
30
|
-
const width = getWidth(numColumns);
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
32
|
-
disabled: !onPress,
|
|
33
|
-
onPress: onPress,
|
|
34
|
-
style: [style, {
|
|
35
|
-
width
|
|
36
|
-
}]
|
|
37
|
-
}, rest), children);
|
|
38
|
-
};
|
|
39
|
-
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
-
exports.default = _default;
|