@draftbit/core 46.2.4-27c60f.5 → 46.2.4-29b0f1.10
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/{Svg.js → SVG.js} +2 -2
- package/lib/commonjs/components/Table/Table.js +35 -0
- package/lib/commonjs/components/Table/TableCell.js +50 -0
- package/lib/commonjs/components/Table/TableHeader.js +41 -0
- package/lib/commonjs/components/Table/TablePaginator.js +17 -0
- package/lib/commonjs/components/Table/TableRow.js +47 -0
- package/lib/commonjs/components/Table/TableTitle.js +60 -0
- package/lib/commonjs/components/Table/index.js +55 -0
- package/lib/commonjs/index.js +45 -7
- package/lib/commonjs/mappings/{Svg.js → SVG.js} +1 -2
- package/lib/commonjs/mappings/Table.js +103 -0
- package/lib/commonjs/utilities.js +2 -2
- package/lib/module/components/Button.js +11 -32
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +6 -24
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +5 -23
- package/lib/module/components/Portal/PortalHost.js +15 -26
- package/lib/module/components/ProgressBar.js +7 -23
- package/lib/module/components/{Svg.js → SVG.js} +2 -2
- package/lib/module/components/StepIndicator.js +16 -33
- package/lib/module/components/Table/Table.js +23 -0
- package/lib/module/components/Table/TableCell.js +37 -0
- package/lib/module/components/Table/TableHeader.js +27 -0
- package/lib/module/components/Table/TablePaginator.js +6 -0
- package/lib/module/components/Table/TableRow.js +33 -0
- package/lib/module/components/Table/TableTitle.js +47 -0
- package/lib/module/components/Table/index.js +6 -0
- package/lib/module/components/TextField.js +30 -62
- package/lib/module/components/ToggleButton.js +3 -17
- package/lib/module/components/Touchable.js +2 -18
- package/lib/module/index.js +2 -1
- package/lib/module/mappings/{Svg.js → SVG.js} +2 -3
- package/lib/module/mappings/Table.js +94 -0
- package/lib/module/utilities.js +3 -3
- package/lib/typescript/src/components/{Svg.d.ts → SVG.d.ts} +3 -3
- package/lib/typescript/src/components/Table/Table.d.ts +8 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +10 -0
- package/lib/typescript/src/components/Table/TableHeader.d.ts +12 -0
- package/lib/typescript/src/components/Table/TablePaginator.d.ts +3 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts +12 -0
- package/lib/typescript/src/components/Table/TableTitle.d.ts +12 -0
- package/lib/typescript/src/components/Table/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/mappings/{Svg.d.ts → SVG.d.ts} +0 -1
- package/lib/typescript/src/mappings/Table.d.ts +153 -0
- package/lib/typescript/src/utilities.d.ts +3 -3
- package/package.json +4 -4
- package/src/components/{Svg.js → SVG.js} +2 -2
- package/src/components/{Svg.tsx → SVG.tsx} +3 -3
- package/src/components/Table/Table.js +10 -0
- package/src/components/Table/Table.tsx +22 -0
- package/src/components/Table/TableCell.js +21 -0
- package/src/components/Table/TableCell.tsx +44 -0
- package/src/components/Table/TableHeader.js +11 -0
- package/src/components/Table/TableHeader.tsx +28 -0
- package/src/components/Table/TablePaginator.js +5 -0
- package/src/components/Table/TablePaginator.tsx +10 -0
- package/src/components/Table/TableRow.js +16 -0
- package/src/components/Table/TableRow.tsx +31 -0
- package/src/components/Table/TableTitle.js +28 -0
- package/src/components/Table/TableTitle.tsx +58 -0
- package/src/components/Table/index.js +6 -0
- package/src/components/Table/index.tsx +6 -0
- package/src/index.js +2 -1
- package/src/index.tsx +10 -1
- package/src/mappings/{Svg.js → SVG.js} +2 -3
- package/src/mappings/{Svg.ts → SVG.ts} +2 -3
- package/src/mappings/Table.js +137 -0
- package/src/mappings/Table.ts +145 -0
- package/src/utilities.js +5 -2
- package/src/utilities.ts +13 -2
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
import omit from "lodash.omit";
|
|
@@ -8,6 +10,8 @@ import TextField from "../TextField";
|
|
|
8
10
|
import Touchable from "../Touchable";
|
|
9
11
|
|
|
10
12
|
const Picker = _ref => {
|
|
13
|
+
var _options$find$label, _options$find;
|
|
14
|
+
|
|
11
15
|
let {
|
|
12
16
|
style,
|
|
13
17
|
options,
|
|
@@ -17,9 +21,6 @@ const Picker = _ref => {
|
|
|
17
21
|
onValueChange: onValueChangeOverride = () => {},
|
|
18
22
|
...props
|
|
19
23
|
} = _ref;
|
|
20
|
-
|
|
21
|
-
var _a, _b;
|
|
22
|
-
|
|
23
24
|
const {
|
|
24
25
|
viewStyles: {
|
|
25
26
|
borderRadius,
|
|
@@ -66,7 +67,7 @@ const Picker = _ref => {
|
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
69
|
-
const selectedLabel = selectedValue && ((
|
|
70
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
70
71
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
71
72
|
disabled: disabled,
|
|
72
73
|
onPress: toggleFocus,
|
|
@@ -88,25 +89,6 @@ const Picker = _ref => {
|
|
|
88
89
|
label: o.label,
|
|
89
90
|
value: o.value,
|
|
90
91
|
key: o.value
|
|
91
|
-
}))), /*#__PURE__*/React.createElement(View, {
|
|
92
|
-
pointerEvents: "none"
|
|
93
|
-
}, /*#__PURE__*/React.createElement(TextField, { ...props,
|
|
94
|
-
value: selectedLabel,
|
|
95
|
-
placeholder: placeholder,
|
|
96
|
-
// @ts-ignore
|
|
97
|
-
ref: textField,
|
|
98
|
-
disabled: disabled,
|
|
99
|
-
// @ts-expect-error
|
|
100
|
-
style: stylesWithoutMargin
|
|
101
|
-
}))));
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const styles = StyleSheet.create({
|
|
105
|
-
container: {
|
|
106
|
-
alignSelf: "stretch"
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
export default withTheme(Picker); key: o.value
|
|
110
92
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
111
93
|
pointerEvents: "none"
|
|
112
94
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
import PortalManager from "./PortalManager";
|
|
@@ -31,11 +33,11 @@ export default class PortalHost extends React.Component {
|
|
|
31
33
|
constructor() {
|
|
32
34
|
super(...arguments);
|
|
33
35
|
|
|
34
|
-
this
|
|
36
|
+
_defineProperty(this, "setManager", manager => {
|
|
35
37
|
this.manager = manager;
|
|
36
|
-
};
|
|
38
|
+
});
|
|
37
39
|
|
|
38
|
-
this
|
|
40
|
+
_defineProperty(this, "mount", children => {
|
|
39
41
|
const key = this.nextKey++;
|
|
40
42
|
|
|
41
43
|
if (this.manager) {
|
|
@@ -49,9 +51,9 @@ export default class PortalHost extends React.Component {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
return key;
|
|
52
|
-
};
|
|
54
|
+
});
|
|
53
55
|
|
|
54
|
-
this
|
|
56
|
+
_defineProperty(this, "update", (key, children) => {
|
|
55
57
|
if (this.manager) {
|
|
56
58
|
this.manager.update(key, children);
|
|
57
59
|
} else {
|
|
@@ -69,9 +71,9 @@ export default class PortalHost extends React.Component {
|
|
|
69
71
|
this.queue.push(op);
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
};
|
|
74
|
+
});
|
|
73
75
|
|
|
74
|
-
this
|
|
76
|
+
_defineProperty(this, "unmount", key => {
|
|
75
77
|
if (this.manager) {
|
|
76
78
|
this.manager.unmount(key);
|
|
77
79
|
} else {
|
|
@@ -80,10 +82,13 @@ export default class PortalHost extends React.Component {
|
|
|
80
82
|
key
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
|
-
};
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
_defineProperty(this, "nextKey", 0);
|
|
88
|
+
|
|
89
|
+
_defineProperty(this, "queue", []);
|
|
84
90
|
|
|
85
|
-
this
|
|
86
|
-
this.queue = [];
|
|
91
|
+
_defineProperty(this, "manager", void 0);
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
componentDidMount() {
|
|
@@ -127,22 +132,6 @@ export default class PortalHost extends React.Component {
|
|
|
127
132
|
}));
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
}
|
|
131
|
-
PortalHost.displayName = "Portal.Host";
|
|
132
|
-
const styles = StyleSheet.create({
|
|
133
|
-
container: {
|
|
134
|
-
flex: 1
|
|
135
|
-
}
|
|
136
|
-
}); }
|
|
137
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
138
|
-
style: styles.container,
|
|
139
|
-
collapsable: false,
|
|
140
|
-
pointerEvents: "box-none"
|
|
141
|
-
}, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
|
|
142
|
-
ref: this.setManager
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
135
|
}
|
|
147
136
|
|
|
148
137
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
|
|
1
5
|
import React, { Component } from "react";
|
|
2
6
|
import { Animated, Easing, View, I18nManager } from "react-native";
|
|
3
7
|
const INDETERMINATE_WIDTH_FACTOR = 0.3;
|
|
@@ -6,7 +10,7 @@ export default class ProgressBar extends Component {
|
|
|
6
10
|
constructor(props) {
|
|
7
11
|
super(props);
|
|
8
12
|
|
|
9
|
-
this
|
|
13
|
+
_defineProperty(this, "handleLayout", event => {
|
|
10
14
|
const {
|
|
11
15
|
width = 150,
|
|
12
16
|
onLayout
|
|
@@ -21,7 +25,7 @@ export default class ProgressBar extends Component {
|
|
|
21
25
|
if (onLayout) {
|
|
22
26
|
onLayout(event);
|
|
23
27
|
}
|
|
24
|
-
};
|
|
28
|
+
});
|
|
25
29
|
|
|
26
30
|
const {
|
|
27
31
|
progress: progressP = 0,
|
|
@@ -75,6 +79,7 @@ export default class ProgressBar extends Component {
|
|
|
75
79
|
Animated[animationType](this.state.progress, { ...animationConfig,
|
|
76
80
|
toValue: progress,
|
|
77
81
|
velocity: 0,
|
|
82
|
+
//adjust this value if animation fails - velocity is required
|
|
78
83
|
useNativeDriver
|
|
79
84
|
}).start();
|
|
80
85
|
} else {
|
|
@@ -145,27 +150,6 @@ export default class ProgressBar extends Component {
|
|
|
145
150
|
})
|
|
146
151
|
}]
|
|
147
152
|
};
|
|
148
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
149
|
-
style: [containerStyle, style],
|
|
150
|
-
onLayout: this.handleLayout,
|
|
151
|
-
...restProps
|
|
152
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
153
|
-
style: progressStyle
|
|
154
|
-
}), children);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
}te.progress.interpolate({
|
|
158
|
-
inputRange: [0, 1],
|
|
159
|
-
outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
|
|
160
|
-
})
|
|
161
|
-
}, {
|
|
162
|
-
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
|
|
163
|
-
scaleX: this.state.progress.interpolate({
|
|
164
|
-
inputRange: [0, 1],
|
|
165
|
-
outputRange: [0.0001, 1]
|
|
166
|
-
})
|
|
167
|
-
}]
|
|
168
|
-
};
|
|
169
153
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
170
154
|
style: [containerStyle, style],
|
|
171
155
|
onLayout: this.handleLayout
|
|
@@ -3,7 +3,7 @@ import { View, Platform, Image } from "react-native";
|
|
|
3
3
|
import { SvgUri } from "react-native-svg";
|
|
4
4
|
import Config from "./Config";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SVG = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
source = Config.placeholderSvgURL,
|
|
9
9
|
style
|
|
@@ -28,4 +28,4 @@ const Svg = _ref => {
|
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export default
|
|
31
|
+
export default SVG;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
// @ts-nocheck
|
|
2
4
|
import React, { Component } from "react";
|
|
3
5
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -10,7 +12,7 @@ export default class StepIndicator extends Component {
|
|
|
10
12
|
constructor(props) {
|
|
11
13
|
super(props);
|
|
12
14
|
|
|
13
|
-
this
|
|
15
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
14
16
|
const {
|
|
15
17
|
stepCount,
|
|
16
18
|
direction
|
|
@@ -55,9 +57,9 @@ export default class StepIndicator extends Component {
|
|
|
55
57
|
},
|
|
56
58
|
style: progressBarBackgroundStyle
|
|
57
59
|
});
|
|
58
|
-
};
|
|
60
|
+
});
|
|
59
61
|
|
|
60
|
-
this
|
|
62
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
61
63
|
const {
|
|
62
64
|
stepCount,
|
|
63
65
|
direction
|
|
@@ -89,9 +91,9 @@ export default class StepIndicator extends Component {
|
|
|
89
91
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
90
92
|
style: progressBarStyle
|
|
91
93
|
});
|
|
92
|
-
};
|
|
94
|
+
});
|
|
93
95
|
|
|
94
|
-
this
|
|
96
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
95
97
|
let steps = [];
|
|
96
98
|
const {
|
|
97
99
|
stepCount,
|
|
@@ -124,9 +126,9 @@ export default class StepIndicator extends Component {
|
|
|
124
126
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
125
127
|
}]
|
|
126
128
|
}, steps);
|
|
127
|
-
};
|
|
129
|
+
});
|
|
128
130
|
|
|
129
|
-
this
|
|
131
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
130
132
|
const {
|
|
131
133
|
labels,
|
|
132
134
|
direction,
|
|
@@ -168,9 +170,9 @@ export default class StepIndicator extends Component {
|
|
|
168
170
|
alignItems: this.state.customStyles.labelAlign
|
|
169
171
|
}]
|
|
170
172
|
}, labelViews);
|
|
171
|
-
};
|
|
173
|
+
});
|
|
172
174
|
|
|
173
|
-
this
|
|
175
|
+
_defineProperty(this, "renderStep", position => {
|
|
174
176
|
const {
|
|
175
177
|
renderStepIndicator
|
|
176
178
|
} = this.props;
|
|
@@ -242,9 +244,9 @@ export default class StepIndicator extends Component {
|
|
|
242
244
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
243
245
|
style: indicatorLabelStyle
|
|
244
246
|
}, "".concat(position + 1)));
|
|
245
|
-
};
|
|
247
|
+
});
|
|
246
248
|
|
|
247
|
-
this
|
|
249
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
248
250
|
const {
|
|
249
251
|
currentPosition
|
|
250
252
|
} = this.props;
|
|
@@ -256,9 +258,9 @@ export default class StepIndicator extends Component {
|
|
|
256
258
|
} else {
|
|
257
259
|
return STEP_STATUS.UNFINISHED;
|
|
258
260
|
}
|
|
259
|
-
};
|
|
261
|
+
});
|
|
260
262
|
|
|
261
|
-
this
|
|
263
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
262
264
|
let {
|
|
263
265
|
stepCount
|
|
264
266
|
} = this.props;
|
|
@@ -280,7 +282,7 @@ export default class StepIndicator extends Component {
|
|
|
280
282
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
281
283
|
duration: 100
|
|
282
284
|
})])]).start();
|
|
283
|
-
};
|
|
285
|
+
});
|
|
284
286
|
|
|
285
287
|
const defaultStyles = {
|
|
286
288
|
stepIndicatorSize: 30,
|
|
@@ -391,25 +393,6 @@ const styles = StyleSheet.create({
|
|
|
391
393
|
justifyContent: "center"
|
|
392
394
|
}
|
|
393
395
|
});
|
|
394
|
-
StepIndicator.defaultProps = {
|
|
395
|
-
currentPosition: 0,
|
|
396
|
-
stepCount: 5,
|
|
397
|
-
customStyles: {},
|
|
398
|
-
direction: "horizontal"
|
|
399
|
-
};s: "center",
|
|
400
|
-
justifyContent: "center"
|
|
401
|
-
},
|
|
402
|
-
stepLabel: {
|
|
403
|
-
fontSize: 12,
|
|
404
|
-
textAlign: "center",
|
|
405
|
-
fontWeight: "500"
|
|
406
|
-
},
|
|
407
|
-
stepLabelItem: {
|
|
408
|
-
flex: 1,
|
|
409
|
-
alignItems: "center",
|
|
410
|
-
justifyContent: "center"
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
396
|
StepIndicator.defaultProps = {
|
|
414
397
|
currentPosition: 0,
|
|
415
398
|
stepCount: 5,
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View, StyleSheet } from "react-native";
|
|
5
|
+
|
|
6
|
+
const Table = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
style,
|
|
10
|
+
...rest
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
13
|
+
style: [styles.wrapper, style]
|
|
14
|
+
}), children);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
wrapper: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export default Table;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
5
|
+
import { extractStyles } from "../../utilities";
|
|
6
|
+
|
|
7
|
+
const TableCell = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
numeric,
|
|
12
|
+
value,
|
|
13
|
+
...rest
|
|
14
|
+
} = _ref;
|
|
15
|
+
const {
|
|
16
|
+
textStyles,
|
|
17
|
+
viewStyles
|
|
18
|
+
} = extractStyles(style);
|
|
19
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
20
|
+
style: [styles.wrapper, numeric && styles.right, viewStyles]
|
|
21
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
22
|
+
numberOfLines: 1,
|
|
23
|
+
style: textStyles
|
|
24
|
+
}, children, value));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
wrapper: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "row"
|
|
32
|
+
},
|
|
33
|
+
right: {
|
|
34
|
+
justifyContent: "flex-end"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export default TableCell;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View, StyleSheet } from "react-native";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
|
|
7
|
+
const TableHeader = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
theme,
|
|
12
|
+
...rest
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
15
|
+
style: [styles.wrapper, {
|
|
16
|
+
borderBottomColor: theme.colors.medium
|
|
17
|
+
}, style]
|
|
18
|
+
}), children);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
wrapper: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
flexDirection: "row"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export default withTheme(TableHeader);
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View, StyleSheet } from "react-native";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
|
|
7
|
+
const TableRow = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
theme,
|
|
12
|
+
...rest
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
15
|
+
style: [styles.container, {
|
|
16
|
+
borderBottomColor: theme.colors.light
|
|
17
|
+
}, style]
|
|
18
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: styles.content
|
|
20
|
+
}, children));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
container: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "row"
|
|
27
|
+
},
|
|
28
|
+
content: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
flexDirection: "row"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export default withTheme(TableRow);
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
5
|
+
import { extractStyles } from "../../utilities";
|
|
6
|
+
|
|
7
|
+
const TableTitle = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
numeric = false,
|
|
12
|
+
isAscending = false,
|
|
13
|
+
numberOfLines = 1,
|
|
14
|
+
title,
|
|
15
|
+
...rest
|
|
16
|
+
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
textStyles,
|
|
19
|
+
viewStyles
|
|
20
|
+
} = extractStyles(style);
|
|
21
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
|
22
|
+
style: [styles.wrapper, numeric && styles.right, viewStyles]
|
|
23
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
24
|
+
style: [isAscending ? styles.sorted : {
|
|
25
|
+
color: "gray"
|
|
26
|
+
}, textStyles],
|
|
27
|
+
numberOfLines: numberOfLines
|
|
28
|
+
}, children, title));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
wrapper: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: "row"
|
|
36
|
+
},
|
|
37
|
+
right: {
|
|
38
|
+
justifyContent: "flex-end"
|
|
39
|
+
},
|
|
40
|
+
sorted: {// marginLeft: 8,
|
|
41
|
+
},
|
|
42
|
+
icon: {
|
|
43
|
+
height: 24,
|
|
44
|
+
justifyContent: "center"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export default TableTitle;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Table } from "./Table";
|
|
2
|
+
export { default as TableHeader } from "./TableHeader";
|
|
3
|
+
export { default as TablePaginator } from "./TablePaginator";
|
|
4
|
+
export { default as TableRow } from "./TableRow";
|
|
5
|
+
export { default as TableCell } from "./TableCell";
|
|
6
|
+
export { default as TableTitle } from "./TableTitle";
|